package com.guigu.work.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.guigu.base.entity.vo.TransportOrderDashboardVO;
import com.guigu.tms.result.R;
import com.guigu.work.dto.TransportOrderDTO;
import com.guigu.work.entity.TransportOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.guigu.work.vo.TransportOrderDetailsVO;

import java.util.List;

/**
 * <p>
 * 运单表 服务类
 * </p>
 *
 * @author liAo
 * @since 2021-11-09
 */
public interface TransportOrderService extends IService<TransportOrder> {
    /**
     * 新增运单
     *
     * @param transportOrderDTO 运单信息
     * @return 运单信息
     */
    TransportOrder saveTransportOrder(TransportOrderDTO transportOrderDTO);

    /**
     * 修改运单信息
     *
     * @param transportOrderDTO
     * @return
     */
    TransportOrder updateTransportOrder(TransportOrderDTO transportOrderDTO);

    /**
     * 分页条件查询
     * 页码-页尺寸-订单Id-运单状态-运单调度状态
     *
     * @param dto
     * @return
     */
    IPage<TransportOrder> findByPage(TransportOrderDTO dto);

    /**
     * 根据订单id获取运单信息
     *
     * @param orderId
     * @return
     */
    TransportOrder findByOrderId(String orderId);

    /**
     * 根据多条件查询运单信息
     *
     * @param dto
     * @return
     */
    List<TransportOrder> findByOrderIds(TransportOrderDTO dto);

    /**
     * 根据运单Id查询运单详情
     *
     * @param transportOrderId
     * @return
     */
    R<TransportOrderDTO> findTransportOrderDetailsById(String transportOrderId);

    /**
     * 根据订单ID查询其对应的线路,车次,车辆,司机数据
     *
     * @param orderId 订单Id
     * @return
     */
    R<TransportOrderDetailsVO> findTransportOrderDetailsByOrderById(String orderId);


    /**
     * 获取运单数量
     *
     * @return
     */
    R<TransportOrderDashboardVO> getTransportOrderCount();
}
